package com.example.service;

import com.example.entity.Bill;
import com.example.mapper.BillMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: huang
 * @Date: 2021/11/1 17:23
 * @Description:
 */
@Service
public class BillService {

    @Resource
    private BillMapper billMapper;

    public List<Bill> list(Bill b) {
        return billMapper.select(b);
    }

    public int add(Bill b) {
        return billMapper.insert(b);
    }

    public Bill get(Long id) {
        return billMapper.selectByPrimaryKey(id);
    }

    public int update(Bill b) {
        return billMapper.updateByPrimaryKey(b);
    }

    public int delete(Long id) {
        return billMapper.deleteByPrimaryKey(id);
    }
}
